<template>
	<view class="about-me">
		<!-- <view class="title">
			<input type="text" placeholder="标题" v-model="abpot.title">
		</view>
		<view class="content">
			<textarea name="content" id="content" cols="30" rows="10" placeholder="内容" v-model="about.content"></textarea>
		</view> -->
		<!-- <rich-text :nodes="about.title"></rich-text> -->
		<uni-forms :modelValue="about">
			<uni-forms-item>
				<view class="dfs">
					<text></text> <text @click="onSubmit">提交</text>
				</view>
			</uni-forms-item>
			<uni-forms-item class="df" label="标题">
				<uni-easyinput v-model="about.title" placeholder="标题"></uni-easyinput>
				<!-- <input type="text" placeholder="标题" v-model="abpot.title"> -->
			</uni-forms-item>
			<uni-form-items label="内容">
				<textarea name="content" id="content" cols="30" rows="10" placeholder="内容" v-model="about.content"></textarea>
			</uni-form-items>
		</uni-forms>
		<!-- <Editor></Editor> -->
		<!-- <EditorPannel ></EditorPannel> -->
		<!-- <view class="editor-wrapper">
			<editor id="editor" class="ql-container" placeholder="开始输入..." show-img-size show-img-toolbar
				show-img-resize @statuschange="onStatusChange" :read-only="readOnly" @ready="onEditorReady">
			</editor>
		</view> -->
		
	</view>
</template>

<script>
	import { GetAbout,EditAbout } from '../../api/index.js'
	export default {
	
		data() {
			return {
				about:{
					title:'',
					content:''
				}
			};
		},
		onLoad() {
			this.getAbout()
		},
		methods:{
			async getAbout(){
				const { data:res } = await GetAbout()
				console.log(res,'aaa')
				if(res.status==0){
					this.about = res.data[0]
				}
			},
			async onSubmit(){
				const {data:res} = await EditAbout(this.about)
				console.log(res,'update')
			}
		}
	}
</script>

<style lang="scss">
.about-me{
	width: 100%;
	padding: 20rpx;
	box-sizing: border-box;
	.title{
		text-align: center;
		margin: 20rpx auto;
	}
	.content{
		width: 100%;
		padding: 20rpx;
	}
	textarea{
		width: 100%;
		padding: 10rpx;
	}
}
</style>
